package com.xzw.test.springcloud.alibaba.controller;

import com.xzw.test.springcloud.alibaba.api.EmailCodeService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {


    @DubboReference
    //@DubboReference(mock = "com.xzw.test.springcloud.alibaba.api.EmailCodeService")
    private EmailCodeService emailCodeService;

    @GetMapping("/send")
    public String send(){
        Boolean bl =emailCodeService.email("xiaoyang@126.com","123456");
        return "发送成功";
    }

    @GetMapping("/hello")
    public String hello(){
        return "Hello Spring Cloud Alibaba Dubbo";
    }

}
